import { ReactElement } from 'react'
import { CaseSchema } from '@src/components/schema/caseSchema'

interface Props {
  data: CaseSchema | null
}

function Main ({ data: d }: Props): ReactElement {
  if (d == null) {
    return <span />
  }
  const o: string[] = []
  if (typeof d.accepter_serieno === 'string') {
    o.push(d.accepter_serieno)
  }
  if (typeof d.processer_serieno === 'string') {
    o.push(d.processer_serieno)
  }
  if (o.length > 0) {
    return <span style={{ color: '#f00' }}>（{o.join('、')}）</span>
  }
  return (
    <span />
  )
}

export default Main
